<template>
    <div class="main">
        <div class="search">
            <div @click="scan" class="left">
                <i class="iconfont icon-Scan"></i>
                <h5>扫一扫</h5>
            </div>
            <div class="input">
                <!-- <i class="iconfont icon-search1187938easyiconnet"></i> -->
                <van-field left-icon="search" @clear="search" size="small" class="input" v-model="batchNo" clearable placeholder="请输入批号/提单号/公司名称" />
                <!-- <input type="text" name="" v-model="batchNo" placeholder="" id=""> -->
            </div>
            <div class="right">
                <button @click="search">搜索</button>
                <!-- <button class="btndz" @click="dingzhi">定制</button> -->
            </div>
        </div>
    </div>
</template>

<script>
    export default {
        props: {
            batchNo: String
        },
        methods: {
            search() {
                this.$emit('search', this.batchNo);
            },
            search2(batchNo) {
                this.$emit('search', batchNo);
            },
            dingzhi() {
                this.$emit('search',"dingzhi");
                 
            },
            scan() {
                var that = this;                
                this.$router.push('/query')
            }
        },
    }
</script>

<style scoped lang='less'>
    .search {
        padding-left: 4rem;
        padding-right: 2em;
        position: relative;
        background: #fafafa;
        height: 50px;
        color: #777;
        .left {
            position: absolute;
            left: 10px;
            top: 5px;
            i {
                font-size: 20px;
                color: 666;
                display: block;
                color: #777;
            }
        }
        .right {
            position: absolute;
            right: 5px;
            top: 10px;
            button {
                background: #2dbaba;
                color: #fff;
                border: 0;
                font-size: 1rem;
                line-height: 2em;
                text-align: center;
                border-radius: 5px;
                padding: 0 1em;
            }
            .btndz{
                background: #f89393;
            }
            
        }
        .input {
            position: relative;
            padding-top: 10px;
            display: flex;
            overflow: hidden;
            i {
                position: absolute;
                left: 5px;
                top: 15px;
            }
            .input {
                border-radius: 10px;
                background: #ededed;                
                color: #000;
                width: calc(100% - 26em);
             }
        }
    }
</style>